<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var arr = [1, 'to', 2, 5, 'for', 22]
			for (var i = arr.length - 1; i >= 0; i--) {
				if (typeof arr[i] === 'number') {
					arr[i]++
				} else {
					arr.splice(i, 1)
				}
			}
			console.log(arr)
		</script>
	</body>
</html>
